<template>
    <div class="home-ordinary-box">
        <div class="content-left-box">
            <div class="one-fourth">
                <a-card title="办件统计" style="width: 100%;height: 100%;" :headStyle="headStyle">
                    <!--<template #extra><a href="#">more</a></template> -->
                    <div class="processing-statistics-box" :key="processingStatisticsKey">
                        <div 
                        v-for="(item,index) in processingStatisticsData" 
                        :key="item.name" 
                        :style="{backgroundColor: item.bgColor}"
                        class="statistics-item"
                        >
                            <div>{{ item.name }}</div>
                            <span class="statistics-num">{{ item.num }}</span>
                        </div>
                    </div>
                </a-card>
            </div>

            <div class="three-quarter">
                <a-card title="科室标签" style="width: 100%;height: 100%;" :headStyle="headStyle">
                    <!-- <template #extra><a href="#">more</a></template> -->
                    <div style="margin: 0 10px;">
                        <a-tabs v-model:activeKey="departmentActiveKey" @change="departmentChange">
                            <a-tab-pane v-for="(item,index) in departmentTab" v-if="item.linkList.length" :key="index" :tab="item.title+'（'+item.num+'）'">
                                <!-- <span class="count-v" style="top: 0;">{{ item.num }}</span> -->
                            </a-tab-pane>
                        </a-tabs>
                        <div class="link-list">
                            <!-- <UnorderedListOutlined /> -->
                            <div class="link-for-v" v-for="(item,index) in departmentTab[departmentActiveKey].linkList" :key="index" @click="JumpClick(item.node,departmentTab[departmentActiveKey].title,item.type||'')">
                                <div class="link-item" :style="{backgroundColor:linkColorList[index]?linkColorList[index]:linkColorList[0]}">
                                    <span class="count-v">{{ Number(item.count) > 99?'99+':item.count }}</span>
                                    <img src="../../../assets/db-icon.png" alt=""/>
                                </div>
                                <span style="display: inline-block;width: 62px;" v-if="item.type">{{ item.type+'-'+item.node }}</span>
                                <span v-else>{{ item.node }}</span>
                            </div>
                        </div>
                    </div>
                    <a-card title="环节待办" :style="{height:departmentTab[departmentActiveKey].linkList.length>7? '51%':'65%'}" style="width: 100%;" :headStyle="headStyle" >
                        <!-- <template #extra><a href="#">more</a></template> -->
                        <div >
                            <a-tabs v-model:activeKey="linkActiveKey" 
                            style="position: absolute;background-color: #fff;width: calc(100% - 20px);padding-top: 8px;top: 39px;" >
                                <a-tab-pane key="全部待办" :tab="'全部待办'+'（'+departmentTab[departmentActiveKey].notDone.length+'）'"></a-tab-pane>
                                <a-tab-pane key="全部超期" :tab="'全部超期'+'（'+departmentTab[departmentActiveKey].overdue.length+'）'"></a-tab-pane>
                            </a-tabs>
                            <div v-if="linkActiveKey == '全部待办'" style="padding-top: 33px">
                                <div v-if="departmentTab[departmentActiveKey].notDone.length"
                                    style="background-color: #fff;padding: 3px;"
                                    v-for="(item,index) in departmentTab[departmentActiveKey].notDone" 
                                    :key="item.id" 
                                    :style="{backgroundColor:isMouseIndex == item.sqsxid?'#f0f5ff':'#fff'}"
                                    @mouseenter="mouseoutChange(item,index)" 
                                    @mouseleave="mousemoveChange(item,index)"
                                    @click="JumpClick(item.fhjmc,item.flcmc,'')"
                                    >
                                    <span style="font-weight: 600;padding-bottom: 3px;">{{ item.flcmc }}</span>
                                    <div 
                                        style="
                                        display: flex;
                                        justify-content: space-between;
                                        align-items: center;
                                        font-size: 14px;
                                        padding: 3px;
                                        ">
                                        <div>
                                            <div>当前环节：{{ item.fhjmc }}</div>
                                            <span>发送时间：{{ item.ffssj }}</span>
                                        </div>
                                        <span>发送人：{{ item.ffsrmc }}</span>
                                    </div>
                                    <div style="width: 100%;height: 5px;background: #f0f2f5;"></div>
                                </div>
                                <div v-else style="text-align: center; line-height: 50px;">
                                    暂无数据
                                </div>
                            </div>

                            <div v-if="linkActiveKey == '全部超期'" style="padding-top: 33px">
                                <div v-if="departmentTab[departmentActiveKey].overdue.length"
                                    style="background-color: #fff;padding: 3px;"
                                    v-for="(item,index) in departmentTab[departmentActiveKey].overdue" 
                                    :key="item.id" 
                                    :style="{backgroundColor:isMouseIndex == item.sqsxid?'#f0f5ff':'#fff'}"
                                    @mouseenter="mouseoutChange(item,index)" 
                                    @mouseleave="mousemoveChange(item,index)"
                                    @click="JumpClick(item.fhjmc,item.flcmc,'')"
                                    >
                                    <span style="font-weight: 600;padding-bottom: 3px;">{{ item.flcmc }}</span>
                                    <div 
                                        style="
                                        display: flex;
                                        justify-content: space-between;
                                        align-items: center;
                                        font-size: 14px;
                                        padding: 3px;
                                        ">
                                        <div>
                                            <div>当前环节：{{ item.fhjmc }}</div>
                                            <span>发送时间：{{ item.ffssj }}</span>
                                        </div>
                                        <span>发送人：{{ item.ffsrmc }}</span>
                                    </div>
                                    <div style="width: 100%;height: 5px;background: #f0f2f5;"></div>
                                </div>
                                <div v-else style="text-align: center; line-height: 50px;">
                                    暂无数据
                                </div>
                            </div>
                        </div>
                    </a-card>
                </a-card>
            </div>
        </div>
        <div class="content-rigth-box">
            <div class="two-thirds">
                <a-card title="行政办公待办" style="width: 100%;height: 100%;" :headStyle="headStyle">
                    <div style="margin: 0 10px;">
                        <!-- <a-tabs v-model:activeKey="aoFlowPathActiveKey" @change="aoFlowPathChange">
                            <a-tab-pane v-for="(item,index) in aoFlowPathTab" :key="index" :tab="item.title+'（'+item.num+'）'">
                            </a-tab-pane>
                        </a-tabs> -->
                        <div style="width: 100%;display: flex;flex-wrap: wrap;">
                            <div v-for="(item,index) in aoFlowPathTab" :key="index" style="padding: 8px 5px;">
                                <span
                                 @click="aoFlowPathActiveKey = index" 
                                 :style="{borderBottom:aoFlowPathActiveKey == index?'solid 2px #2F54EB':'0',color:aoFlowPathActiveKey == index?'#2F54EB':''}"
                                 style="display: inline-block;padding: 0 3px 0 6px;"
                                 >{{ item.title+'（'+item.num+'）' }}</span>
                            </div>
                        </div>
                        <div class="link-list">
                            <!-- <UnorderedListOutlined /> -->
                            <div  class="link-for-v" v-for="(item,index) in aoFlowPathTab[aoFlowPathActiveKey].list" v-if="aoFlowPathTab[aoFlowPathActiveKey].list.length" :key="index" @click="oaJumpsClick(item.node,aoFlowPathTab[aoFlowPathActiveKey].title,item.type||'')">
                                <div class="link-item" :style="{backgroundColor:linkColorList[index]?linkColorList[index]:linkColorList[0]}">
                                    <span class="count-v">{{ Number(item.count) > 99?'99+':item.count }}</span>
                                    <img src="../../../assets/db-icon.png" alt=""/>
                                </div>
                                <span style="display: inline-block;width: 62px;" v-if="item.type">{{ item.type+'-'+item.node }}</span>
                                <span v-else>{{ item.node }}</span>
                            </div>
                            <div v-if="!aoFlowPathTab[aoFlowPathActiveKey].list.length" style="text-align: center; line-height: 50px;width: 100%;">
                                暂无数据
                            </div>
                        </div>
                    </div>
                    <!-- <a-card title="全部待办" 
                    v-if="aoFlowPathTab[aoFlowPathActiveKey].data.length"
                    :style="{height:aoFlowPathTab[aoFlowPathActiveKey].data.length>7? '51%':'65%'}" 
                    style="width: 100%;" :headStyle="headStyle" >
                        <div >
                            <div>
                                <div
                                    style="background-color: #fff;padding: 3px;"
                                    v-for="(item,index) in aoFlowPathTab[aoFlowPathActiveKey].data" 
                                    :key="item.id" 
                                    :style="{backgroundColor:isMouseIndex == item.jobid?'#f0f5ff':'#fff'}"
                                    @mouseenter="mouseoutChange(item,index)" 
                                    @mouseleave="mousemoveChange(item,index)"
                                    @click="oaJumpsClick(item.fhjmc,aoFlowPathTab[aoFlowPathActiveKey].title,'')"
                                    >
                                    <span style="font-weight: 600;padding-bottom: 3px;">{{ aoFlowPathTab[aoFlowPathActiveKey].title }}</span>
                                    <div 
                                        style="
                                        display: flex;
                                        justify-content: space-between;
                                        align-items: center;
                                        font-size: 14px;
                                        padding: 3px;
                                        ">
                                        <div>
                                            <div>当前环节：{{ item.fhjmc }}</div>
                                            <span>发送时间：{{ item.ffssj }}</span>
                                        </div>
                                        <span>发送人：{{ item.ffsrmc }}</span>
                                    </div>
                                    <div style="width: 100%;height: 5px;background: #f0f2f5;"></div>
                                </div>
                            </div>
                        </div>
                    </a-card> -->
                </a-card>
            </div>
            <div class="one-third">
                <a-card title="其他待办" style="width: 100%;height: 100%;" :headStyle="headStyle">
                    <div style="padding: 8px;">
                        <a-tabs v-model:activeKey="activeKeyBtnLeft">
                            <a-tab-pane key="质量体系文件" tab="质量体系文件" >
                                <div class="link-list" v-if="qualitySystemList.length">
                                    <div class="link-for-v" v-for="(item,index) in qualitySystemList" :key="index" @click="JumpClick(item.node,'质量体系文件',item.type||'')">
                                        <div class="link-item" :style="{backgroundColor:linkColorList[index]?linkColorList[index]:linkColorList[0]}">
                                            <span class="count-v">{{ Number(item.count) > 99?'99+':item.count }}</span>
                                            <img src="../../../assets/db-icon.png" alt=""/>
                                        </div>
                                        <span>{{ item.node }}</span>
                                    </div>
                                </div>
                                <div v-else style="text-align: center; line-height: 50px;">
                                    暂无数据
                                </div>
                            </a-tab-pane>
                            <a-tab-pane key="审评员日常考评" tab="审评员日常考评" >
                                <div class="link-list" v-if="dailyEvaluationList.length">
                                    <div  class="link-for-v" v-for="(item,index) in dailyEvaluationList" :key="index" @click="JumpClick(item.node,'审评员日常考评',item.type||'')">
                                        <div class="link-item" :style="{backgroundColor:linkColorList[index]?linkColorList[index]:linkColorList[0]}">
                                            <span class="count-v">{{ Number(item.count) > 99?'99+':item.count }}</span>
                                            <img src="../../../assets/db-icon.png" alt=""/>
                                        </div>
                                        <span>{{ item.node }}</span>
                                    </div>
                                </div>
                                <div v-else style="text-align: center; line-height: 50px;">
                                    暂无数据
                                </div>
                            </a-tab-pane>
                            <a-tab-pane key="预备审评员考评" tab="预备审评员考评" >
                                <div class="link-list" v-if="preliminaryEvaluationList.length">
                                    <div class="link-for-v" v-for="(item,index) in preliminaryEvaluationList" :key="index" @click="JumpClick(item.node,'预备审评员考评',item.type||'')">
                                        <div class="link-item" :style="{backgroundColor:linkColorList[index]?linkColorList[index]:linkColorList[0]}">
                                            <span class="count-v">{{ Number(item.count) > 99?'99+':item.count }}</span>
                                            <img src="../../../assets/db-icon.png" alt=""/>
                                        </div>
                                        <span>{{ item.node }}</span>
                                    </div>
                                </div>
                                <div v-else style="text-align: center; line-height: 50px;">
                                    暂无数据
                                </div>
                            </a-tab-pane>
                            <a-tab-pane key="审评员年度考评" tab="审评员年度考评" >
                                <div class="link-list" v-if="annualEvaluationTabIsDisplay">
                                    <div style="display: inline-block;" v-for="(tItem,tIndex) in annualEvaluationTab" :key="tIndex">
                                        <div class="link-for-v" v-for="(item,index) in tItem.list" :key="index" @click="JumpClick(item.node,'审评员年度考评',item.type||'')">
                                            <div class="link-item" :style="{backgroundColor:linkColorList[index]?linkColorList[index]:linkColorList[0]}">
                                                <span class="count-v">{{ Number(item.count) > 99?'99+':item.count }}</span>
                                                <img src="../../../assets/db-icon.png" alt=""/>
                                            </div>
                                            <span v-if="item.dep">{{ item.dep+'-'+item.node }}</span>
                                            <span v-else>{{ item.node }}</span>
                                        </div>
                                    </div>
                                    
                                </div>
                                <div v-else style="text-align: center; line-height: 50px;">
                                    暂无数据
                                </div>
                            </a-tab-pane>
                        </a-tabs>
                    </div>
                </a-card>
            </div>
        </div>
    </div>
</template>
<script>
import { queryMyFlowTjData, queryAllYwflFlowJob, mydbQueryAlloaFlowJob } from './service/index'
export default {
    components:{
    },
    props:{

    },
    data(){
        return{
            headStyle:{"font-weight": "600","min-height":"38px",'position': 'relative'},
            processingStatisticsKey:null,
            processingStatisticsData:[{
                name:'本月待办件',
                num:'0',
                bgColor:'rgb(240, 244, 255)'
            },{
                name:'本月超期件',
                num:'0',
                bgColor:'rgb(234, 248, 249)'
            },{
                name:'累计已办件',
                num:'0',
                bgColor:'rgb(252, 246, 234)'
            },{
                name:'累计超期已办件',
                num:'0',
                bgColor:'rgb(240, 239, 253)'
            }],
            departmentActiveKey:0,
            departmentTab:[{
                title:'药品生产',
                key:'ypsc',
                num:0,
                isDisplay:false,
                notDone:[],
                overdue:[],
                linkList:[],
            },{
                title:'药品流通',
                key:'yplt',
                num:0,
                isDisplay:false,
                notDone:[],
                overdue:[],
                linkList:[],
            },{
                title:'药品注册',
                key:'ypzc',
                num:0,
                isDisplay:false,
                notDone:[],
                overdue:[],
                linkList:[],
            },{
                title:'化妆品',
                key:'hzp',
                num:0,
                isDisplay:false,
                notDone:[],
                overdue:[],
                linkList:[],
            },{
                title:'医疗器械',
                key:'ylqx',
                num:0,
                isDisplay:false,
                notDone:[],
                overdue:[],
                linkList:[],
            }],
            annualEvaluationTab:[{
                title:'药品生产',
                key:'ypsc',
                num:0,
                list:[],
            },{
                title:'药品流通',
                key:'yplt',
                num:0,
                list:[],
            },{
                title:'药品注册',
                key:'ypzc',
                num:0,
                list:[],
            },{
                title:'化妆品',
                key:'hzp',
                num:0,
                list:[]
            },{
                title:'医疗器械',
                key:'ylqx',
                num:0,
                list:[],
            }],
            linkActiveKey:'全部待办',
            isMouseIndex:null,
            linkColorList:[
                'rgb(81, 161, 250)',
                'rgb(79, 182, 109)',
                'rgb(153, 112, 218)',
                'rgb(227, 90, 146)',
                'rgb(81, 161, 250)',
                'rgb(79, 182, 109)',
                'rgb(153, 112, 218)',
                'rgb(227, 90, 146)'
            ],
            linkListData:[],
            notDoneData:[],
            overdueData:[],
            currentDepartmentName:'药品生产',
            linkListH:0,
            activeKeyBtnLeft:'质量体系文件',
            linkUrlData:[{
                url:'/assessCheck/acceptanceRegistration__drugProduce_a',
                name:'任务受理',
                title:'药品生产',
            },{
                url:'/assessCheck/schemeProduction/index__drugProduce_a',
                name:'方案制定',
                title:'药品生产',
            },{
                url:'/assessCheck/schemeReview/schemeReview__drugProduce_a',
                name:'方案审核',
                title:'药品生产',
            },{
                url:'/assessCheck/schemeApproval/schemeApproval__drugProduce_a',
                name:'方案审批',
                title:'药品生产',
            },{
                url:'/assessCheck/siteInspection__drugProduce_a',
                name:'技术审评',
                title:'药品生产',
            },{
                url:'/assessCheck/comprehensiveReview__drugProduce_a',
                name:'综合评定',
                title:'药品生产',
            },{
                url:'/assessCheck/departmentReview__drugProduce_a',
                name:'科室复核',
                title:'药品生产',
            },{
                url:'/assessCheck/transferConfirmation__drugProduce_a',
                name:'移送确认',
                title:'药品生产',
            },
            //医疗器械
            {
                url:'/medicalEquipment/acceptanceRegistration__medicalEquipment_a',
                name:'任务受理',
                title:'医疗器械',
            },{
                url:'/medicalEquipment/taskAllocation__medicalEquipment_a',
                name:'任务分配',
                title:'医疗器械',
            },{
                url:'/medicalEquipment/schemeProduction/index__medicalEquipment_a',
                name:'方案制定',
                title:'医疗器械',
            },{
                url:'/medicalEquipment/schemeReview/schemeReview__medicalEquipment_a查验方案审核_$',
                name:'查验方案审核',
                title:'医疗器械',
            },{
                url:'/medicalEquipment/schemeApproval/schemeApproval__medicalEquipment_a查验方案审批_$',
                name:'查验方案审批',
                title:'医疗器械',
            },{
                url:'/medicalEquipment/schemeReview/schemeReview__medicalEquipment_a审评方案审核_$',
                name:'审评方案审核',
                title:'医疗器械',
            },{
                url:'/medicalEquipment/schemeApproval/schemeApproval__medicalEquipment_a审评方案审批_$',
                name:'审评方案审批',
                title:'医疗器械',
            },{
                url:'/medicalEquipment/siteInspection__medicalEquipment_a技术审评_$',
                name:'技术审评',
                title:'医疗器械',
            },{
                url:'/medicalEquipment/siteInspection__medicalEquipment_a技术审评_$',
                name:'技术审评',
                title:'医疗器械',
            },{
                url:'/medicalEquipment/comprehensiveReview__medicalEquipment_a',
                name:'综合评定',
                title:'医疗器械',
            },{
                url:'/medicalEquipment/departmentReview__medicalEquipment_a',
                name:'科室复核',
                title:'医疗器械',
            },{
                url:'/medicalEquipment/transferConfirmation__medicalEquipment_a',
                name:'移送确认',
                title:'医疗器械',
            },{
                path:'/medicalEquipment/correctionProcess/departmentReview/index',
                name:'科室复核',
                type:'补正流程',
                title:'医疗器械',
            },{
                path:'/medicalEquipment/correctionProcess/approvalInCharge/index',
                name:'分管审批',
                type:'补正流程',
                title:'医疗器械',
            },{
                path:'/medicalEquipment/reviewExperts/departmentReview/index',
                name:'科室复核',
                type:'审评专家',
                title:'医疗器械',
            },{
                path:'/medicalEquipment/reviewExperts/approvalInCharge/index',
                name:'分管审批',
                type:'审评专家',
                title:'医疗器械',
            },{
                path:'/medicalEquipment/reviewExperts/expertOpinion/index__medicalEquipment_a',
                name:'专家意见',
                type:'审评专家',
                title:'医疗器械',
            },
            //药品流通
            {
                url:'/drugCirculation/acceptanceRegistration__drugCirculation_a',
                name:'任务受理',
                title:'药品流通',
            },{
                url:'/drugCirculation/schemeProduction/index__drugCirculation_a',
                name:'方案制定',
                title:'药品流通',
            },{
                url:'/drugCirculation/schemeReview/schemeReview__drugCirculation_a',
                name:'方案审核',
                title:'药品流通',
            },{
                url:'/drugCirculation/schemeApproval/schemeApproval__drugCirculation_a',
                name:'方案审批',
                title:'药品流通',
            },{
                url:'/drugCirculation/siteInspection__drugCirculation_a',
                name:'技术审评',
                title:'药品流通',
            },{
                url:'/drugCirculation/comprehensiveReview__drugCirculation_a',
                name:'综合评定',
                title:'药品流通',
            },{
                url:'/drugCirculation/departmentReview__drugCirculation_a',
                name:'科室复核',
                title:'药品流通',
            },{
                url:'/drugCirculation/transferConfirmation__drugCirculation_a',
                name:'移送确认',
                title:'药品流通',
            },{
                url:'/drugCirculation/correctionProcess/departmentReview/index',
                name:'科室复核',
                type:'审查报告',
                title:'药品流通',
            },{
                url:'/drugCirculation/correctionProcess/approvalInCharge/index',
                name:'分管审批',
                type:'审查报告',
                title:'药品流通',
            },
            //化妆品
            {
                url:'/cosmetics/acceptanceRegistration__maquillage_a',
                name:'任务受理',
                title:'化妆品',
            },{
                url:'/cosmetics/schemeProduction/index__maquillage_a',
                name:'方案制定',
                title:'化妆品',
            },{
                url:'/cosmetics/schemeReview/schemeReview__maquillage_a查验方案审核_$',
                name:'查验方案审核',
                title:'化妆品',
            },{
                url:'/cosmetics/schemeApproval/schemeApproval__maquillage_a查验方案审批_$',
                name:'查验方案审批',
                title:'化妆品',
            },{
                url:'/cosmetics/siteInspection__maquillage_a技术审评_$',
                name:'技术审评',
                title:'化妆品',
            },{
                url:'/cosmetics/siteInspection__maquillage_a技术审评_$',
                name:'技术审评',
                title:'化妆品',
            },{
                url:'/cosmetics/comprehensiveReview__maquillage_a',
                name:'综合评定',
                title:'化妆品',
            },{
                url:'/cosmetics/departmentReview__maquillage_a',
                name:'科室复核',
                title:'化妆品',
            },{
                url:'/cosmetics/transferConfirmation__maquillage_a',
                name:'移送确认',
                title:'化妆品',
            },{
                path:'/cosmetics/correctionProcess/departmentReview/index__maquillage_a',
                name:'科室复核',
                type:'补正流程',
                title:'化妆品',
            },{
                path:'/cosmetics/correctionProcess/approvalInCharge/index__maquillage_a',
                name:'分管审批',
                type:'补正流程',
                title:'化妆品',
            },{
                path:'/cosmetics/reviewExperts/departmentReview/index__maquillage_a',
                name:'科室复核',
                type:'审评专家',
                title:'化妆品',
            },{
                path:'/cosmetics/reviewExperts/approvalInCharge/index__maquillage_a',
                name:'分管审批',
                type:'审评专家',
                title:'化妆品',
            },{
                path:'/cosmetics/reviewExperts/expertOpinion/index__maquillage_a',
                name:'专家意见',
                type:'审评专家',
                title:'化妆品',
            },

            //质量体系文件
            {
                url:'/assessCheck/qualityFlow/indexFlowApply',
                name:'申请',
                title:'质量体系文件',
            },{
                url:'/assessCheck/qualityFlow/indexFlowExamine',
                name:'科室复核',
                title:'质量体系文件',
            },{
                url:'/assessCheck/qualityFlow/indexFlowResponsibilities',
                name:'分管领导',
                title:'质量体系文件',
            },{
                url:'/assessCheck/qualityFlow/indexFlowManage',
                name:'管理者代表',
                title:'质量体系文件',
            },{
                url:'/assessCheck/qualityFlow/indexFlowLeader',
                name:'中心领导',
                title:'质量体系文件',
            },{
                url:'/assessCheck/qualityFlow/revisionConfirmation',
                name:'修订确认',
                title:'质量体系文件',
            },
            //药品注册
            {
                url:'/drugRegistration/acceptanceTaskEntry__drugRegistration_a',
                name:'任务录入',
                title:'药品注册',
            },{
                url:'/drugRegistration/acceptanceRegistration__drugRegistration_a',
                name:'任务受理',
                title:'药品注册',
            },{
                url:'/drugRegistration/schemeProduction/index__drugRegistration_a',
                name:'方案制定',
                title:'药品注册',
            },{
                url:'/drugRegistration/schemeReview/schemeReview__drugRegistration_a查验方案审核_$',
                name:'查验方案审核',
                title:'药品注册',
            },{
                url:'/drugRegistration/schemeApproval/schemeApproval__drugRegistration_a查验方案审批_$',
                name:'查验方案审批',
                title:'药品注册',
            },{
                url:'/drugRegistration/siteInspection__drugRegistration_a技术审评_$',
                name:'技术审评',
                title:'药品注册',
            },{
                url:'/drugRegistration/siteInspection__drugRegistration_a技术审评_$',
                name:'技术审评',
                title:'药品注册',
            },{
                url:'/drugRegistration/comprehensiveReview__drugRegistration_a',
                name:'综合评定',
                title:'药品注册',
            },{
                url:'/drugRegistration/departmentReview__drugRegistration_a',
                name:'科室复核',
                title:'药品注册',
            },{
                url:'/drugRegistration/transferConfirmation__drugRegistration_a',
                name:'移送确认',
                title:'药品注册',
            },{
                path:'/drugRegistration/correctionProcess/departmentReview/index',
                name:'科室复核',
                type:'补正流程',
                title:'药品注册',
            },{
                path:'/drugRegistration/correctionProcess/approvalInCharge/index',
                name:'分管审批',
                type:'补正流程',
                title:'药品注册',
            },{
                path:'/drugRegistration/reviewExperts/departmentReview/index',
                name:'科室复核',
                type:'审评专家',
                title:'药品注册',
            },{
                path:'/drugRegistration/reviewExperts/approvalInCharge/index',
                name:'分管审批',
                type:'审评专家',
                title:'药品注册',
            },{
                path:'/drugRegistration/reviewExperts/expertOpinion/index__drugRegistration_a',
                name:'专家意见',
                type:'审评专家',
                title:'药品注册',
            },
            //日常考评
            {
                url:'/everydayCheck/stayPage/checkPage',
                name:'待审核日常考评',
                title:'审评员日常考评',
            },{
                url:'/everydayCheck/stayPage/reexaminePage',
                name:'待复核列表',
                title:'审评员日常考评',
            },{
                url:'/everydayCheck/stayPage/auditPage',
                name:'待审批列表',
                title:'审评员日常考评',
            },{
                url:'/everydayCheck/stayPage/registerStatistics',
                name:'药品注册考评统计',
                title:'审评员日常考评',
            },{
                url:'/everydayCheck/stayPage/circulateStatistics',
                name:'药品流通考评统计',
                title:'审评员日常考评',
            },{
                url:'/everydayCheck/stayPage/statistics',
                name:'药品生产考评统计',
                title:'审评员日常考评',
            },{
                url:'/everydayCheck/stayPage/makeStatistics',
                name:'化妆品考评统计',
                title:'审评员日常考评',
            },{
                url:'/everydayCheck/stayPage/medicalStatistics',
                name:'医疗器械考评统计',
                title:'审评员日常考评',
            },
            //预备审评员考评
            {
                url:'/everydayCheck/prepareinspectorm/PersonalSummary',
                name:'个人总结',
                title:'预备审评员考评',
            },{
                url:'/everydayCheck/prepareinspectorm/PersonalSummaryzz',
                name:'组长评价',
                title:'预备审评员考评',
            },{
                url:'/everydayCheck/prepareinspectorm/PersonalSummarysh',
                name:'经办人审核',
                title:'预备审评员考评',
            },{
                url:'/everydayCheck/prepareinspectorm/prepareTj',
                name:'预备审评员统计',
                title:'预备审评员考评',
            },
            //审评员年度考评
            {
                path:'/everydayCheck/yearCheck/ypscPage/zcdengjiPage',
                name:'考评登记',
                type:'药品注册',
                title:'审评员年度考评',
            },{
                path:'/everydayCheck/yearCheck/ypscPage/zcyregistered',
                name:'已登记年度考评',
                type:'药品注册',
                title:'审评员年度考评',
            },{
                path:'/assessmentExamination/register__个人总结_a__drugRegistration_a',
                name:'个人总结',
                type:'药品注册',
                title:'审评员年度考评',
            },{
                path:'/everydayCheck/yearCheck/ypscPage/zcauditPage',
                name:'考评审核',
                type:'药品注册',
                title:'审评员年度考评',
            },{
                path:'/everydayCheck/yearCheck/ypscPage/zcreexaminePage',
                name:'考评复核',
                type:'药品注册',
                title:'审评员年度考评',
            },{
                path:'/everydayCheck/yearCheck/ypscPage/zcExamineApprove',
                name:'考评审批',
                type:'药品注册',
                title:'审评员年度考评',
            },{
                path:'/everydayCheck/yearCheck/ypscPage/zcaccomplishPage',
                name:'已完成年度考评',
                type:'药品注册',
                title:'审评员年度考评',
            },{
                path:'/everydayCheck/yearCheck/ypscPage/zcstatistics',
                name:'年度考评统计',
                type:'药品注册',
                title:'审评员年度考评',
            },
            //
            {
                path:'/assessmentExamination/register__考评登记_a__drugCirculation_a',
                name:'考评登记',
                type:'药品流通',
                title:'审评员年度考评',
            },{
                path:'/everydayCheck/yearCheck/ypscPage/yregistered__drugCirculation_a',
                name:'已登记年度考评',
                type:'药品流通',
                title:'审评员年度考评',
            },{
                path:'/assessmentExamination/register__个人总结_a__drugCirculation_a',
                name:'个人总结',
                type:'药品流通',
                title:'审评员年度考评',
            },{
                path:'/assessmentExamination/register__考评审核_a__drugCirculation_a',
                name:'考评审核',
                type:'药品流通',
                title:'审评员年度考评',
            },{
                path:'/assessmentExamination/register__考评复核_a__drugCirculation_a',
                name:'考评复核',
                type:'药品流通',
                title:'审评员年度考评',
            },{
                path:'/assessmentExamination/register__考评审批_a__drugCirculation_a',
                name:'考评审批',
                type:'药品流通',
                title:'审评员年度考评',
            },{
                path:'/everydayCheck/yearCheck/ypscPage/accomplishPage__drugCirculation_a',
                name:'已完成年度考评',
                type:'药品流通',
                title:'审评员年度考评',
            },{
                path:'/everydayCheck/yearCheck/ypscPage/statistics__drugCirculation_a',
                name:'年度考评统计',
                type:'药品流通',
                title:'审评员年度考评',
            },
            //
            {
                path:'/assessmentExamination/register__考评登记_a__drugProduce_a',
                name:'考评登记',
                type:'药品生产',
                title:'审评员年度考评',
            },{
                path:'/everydayCheck/yearCheck/ypscPage/yregistered',
                name:'已登记年度考评',
                type:'药品生产',
                title:'审评员年度考评',
            },{
                path:'/assessmentExamination/register__个人总结_a',
                name:'个人总结',
                type:'药品生产',
                title:'审评员年度考评',
            },{
                path:'/assessmentExamination/register__考评审核_a',
                name:'考评审核',
                type:'药品生产',
                title:'审评员年度考评',
            },{
                path:'/assessmentExamination/register__考评复核_a',
                name:'考评复核',
                type:'药品生产',
                title:'审评员年度考评',
            },{
                path:'/assessmentExamination/register__考评审批_a',
                name:'考评审批',
                type:'药品生产',
                title:'审评员年度考评',
            },{
                path:'/everydayCheck/yearCheck/ypscPage/accomplishPage',
                name:'已完成年度考评',
                type:'药品生产',
                title:'审评员年度考评',
            },{
                path:'/everydayCheck/yearCheck/ypscPage/statistics',
                name:'年度考评统计',
                type:'药品生产',
                title:'审评员年度考评',
            },
            //
            {
                path:'/assessmentExamination/register__考评登记_a__medicalEquipment_a',
                name:'考评登记',
                type:'医疗器械',
                title:'审评员年度考评',
            },{
                path:'/everydayCheck/yearCheck/ypscPage/yregistered__medicalEquipment_a',
                name:'已登记年度考评',
                type:'医疗器械',
                title:'审评员年度考评',
            },{
                path:'/assessmentExamination/register__个人总结_a__medicalEquipment_a',
                name:'个人总结',
                type:'医疗器械',
                title:'审评员年度考评',
            },{
                path:'/assessmentExamination/register__考评审核_a__medicalEquipment_a',
                name:'考评审核',
                type:'医疗器械',
                title:'审评员年度考评',
            },{
                path:'/assessmentExamination/register__考评复核_a__medicalEquipment_a',
                name:'考评复核',
                type:'医疗器械',
                title:'审评员年度考评',
            },{
                path:'/assessmentExamination/register__考评审批_a__medicalEquipment_a',
                name:'考评审批',
                type:'医疗器械',
                title:'审评员年度考评',
            },{
                path:'/everydayCheck/yearCheck/ypscPage/accomplishPage__medicalEquipment_a',
                name:'已完成年度考评',
                type:'医疗器械',
                title:'审评员年度考评',
            },{
                path:'/everydayCheck/yearCheck/ypscPage/statistics__medicalEquipment_a',
                name:'年度考评统计',
                type:'医疗器械',
                title:'审评员年度考评',
            },
            //
            {
                path:'/assessmentExamination/register__考评登记_a__maquillage_a',
                name:'考评登记',
                type:'化妆品',
                title:'审评员年度考评',
            },{
                path:'/everydayCheck/yearCheck/ypscPage/yregistered__maquillage_a',
                name:'已登记年度考评',
                type:'化妆品',
                title:'审评员年度考评',
            },{
                path:'/assessmentExamination/register__个人总结_a__maquillage_a',
                name:'个人总结',
                type:'化妆品',
                title:'审评员年度考评',
            },{
                path:'/assessmentExamination/register__考评审核_a__maquillage_a',
                name:'考评审核',
                type:'化妆品',
                title:'审评员年度考评',
            },{
                path:'/assessmentExamination/register__考评复核_a__maquillage_a',
                name:'考评复核',
                type:'化妆品',
                title:'审评员年度考评',
            },{
                path:'/assessmentExamination/register__考评审批_a__maquillage_a',
                name:'考评审批',
                type:'化妆品',
                title:'审评员年度考评',
            },{
                path:'/everydayCheck/yearCheck/ypscPage/accomplishPage__maquillage_a',
                name:'已完成年度考评',
                type:'化妆品',
                title:'审评员年度考评',
            },{
                path:'/everydayCheck/yearCheck/ypscPage/statistics__maquillage_a',
                name:'年度考评统计',
                type:'化妆品',
                title:'审评员年度考评',
            },
            ],
            qualitySystemList:[],
            dailyEvaluationList:[],
            preliminaryEvaluationList:[],
            annualEvaluationList:[],
            annualEvaluationTabIsDisplay:false,
            aoFlowPathActiveKey:0,
            aoFlowPathTab:[{
                title:'行政事务审批',
                key:'oaxzswsp',
                num:0,
                isDisplay:false,
                list:[],
                data:[],
            },{
                title:'办公用品申请',
                key:'oabgypsqgl',
                num:0,
                isDisplay:false,
                list:[],
                data:[],
            },{
                title:'宣传信息审批',
                key:'oaxcxxsp',
                num:0,
                isDisplay:false,
                list:[],
                data:[],
            },{
                title:'会议室申请管理',
                key:'oahysgl',
                num:0,
                isDisplay:false,
                list:[],
                data:[],
            },{
                title:'离岗请示',
                key:'oalgqs',
                num:0,
                isDisplay:false,
                list:[],
                data:[],
            }],
            OALinkUrlData:[{
                url:'/administrativeOffice/applyFor/applicationReview/index',
                name:'起草',
                title:'行政事务审批',
            },{
                url:'/administrativeOffice/applyFor/applicationReview/index1',
                name:'科室审核',
                title:'行政事务审批',
            },{
                url:'/administrativeOffice/applyFor/applicationReview/index2',
                name:'办公室意见',
                title:'行政事务审批',
            },{
                url:'/administrativeOffice/applyFor/applicationReview/index3',
                name:'领导审核',
                title:'行政事务审批',
            },
            //办公用品申请
            {
                url:'/administrativeOffice/officeSupplies/index/index',
                name:'申请',
                title:'办公用品申请',
            },{
                url:'/administrativeOffice/officeSupplies/approve/index1',
                name:'科室审批',
                title:'办公用品申请',
            },{
                url:'/administrativeOffice/officeSupplies/approve/index2',
                name:'办公室确认',
                title:'办公用品申请',
            },
            //宣传信息审批
            {
                url:'/administrativeOffice/websiteInformation/informationRelease/index',
                name:'申请',
                title:'宣传信息审批',
            },{
                url:'/administrativeOffice/websiteInformation/informationRelease/index1',
                name:'科室审批',
                title:'宣传信息审批',
            },{
                url:'/administrativeOffice/websiteInformation/informationRelease/index2',
                name:'办公室审批',
                title:'宣传信息审批',
            },{
                url:'/administrativeOffice/websiteInformation/informationRelease/index3',
                name:'分管领导审批',
                title:'宣传信息审批',
            },{
                url:'/administrativeOffice/websiteInformation/informationRelease/index4',
                name:'单位领导审批',
                title:'宣传信息审批',
            },{
                url:'/administrativeOffice/websiteInformation/informationRelease/index5',
                name:'信息发布办理',
                title:'宣传信息审批',
            },{
                url:'/administrativeOffice/websiteInformation/informationRelease/index3',
                name:'中心分管领导审批',
                title:'宣传信息审批',
            },{
                url:'/administrativeOffice/websiteInformation/informationRelease/index4',
                name:'中心主要领导审批',
                title:'宣传信息审批',
            },
            //会议室申请管理
            {
                url:'/administrativeOffice/conferenceRoomManagement/meetingRoomApplication/index',
                name:'申请确认',
                title:'会议室申请管理',
            },{
                url:'/administrativeOffice/conferenceRoomManagement/meetingRoomApplication/index1',
                name:'科室审批',
                title:'会议室申请管理',
            },{
                url:'/administrativeOffice/conferenceRoomManagement/meetingRoomApplication/index2',
                name:'办公室审批',
                title:'会议室申请管理',
            },{
                url:'/administrativeOffice/conferenceRoomManagement/meetingRoomApplication/index3',
                name:'会议安排',
                title:'会议室申请管理',
            },

            //离岗请示
            {
                url:'/administrativeOffice/departureRequest/leaveApplication/index',
                name:'离岗申请',
                title:'离岗请示',
            },{
                url:'/administrativeOffice/departureRequest/leaveApplication/index1',
                name:'科室审批',
                title:'离岗请示',
            },{
                url:'/administrativeOffice/departureRequest/leaveApplication/index2',
                name:'分管领导审批',
                title:'离岗请示',
            },{
                url:'/administrativeOffice/departureRequest/leaveApplication/index4',
                name:'销假',
                title:'离岗请示',
            },
            ],
        }
    },
    watch:{

    },
    mounted(){
        this.getData()
    },
    methods:{
        getData(){
            queryMyFlowTjData().then(res=>{
                if(res.code == 200){
                    //console.log(res.result.myTj)
                    this.processingStatisticsData[0].num = res.result.myTj.bydbbls?res.result.myTj.bydbbls:0
                    this.processingStatisticsData[1].num = res.result.myTj.bydbcqs?res.result.myTj.bydbcqs:0
                    this.processingStatisticsData[2].num = res.result.myTj.ljybsl?res.result.myTj.ljybsl:0
                    this.processingStatisticsData[3].num = res.result.myTj.ljybcqs?res.result.myTj.ljybcqs:0
                    this.processingStatisticsKey = Date.now()
                }
            })
            queryAllYwflFlowJob().then(res=>{
                if(res.code == 200){
                    this.overdueData = res.result.spcy.ypsc.dbCqList
                    this.notDoneData = res.result.spcy.ypsc.dbList
                    this.linkListData = res.result.spcy.ypsc.nodeTj
                    let spcyData = res.result.spcy
                    let annualEvaluationData = res.result.ndkp
                    let recordIndex = ''
                    this.qualitySystemList = res.result['zltxwj'].zltxwjFlowNodeTj
                    this.dailyEvaluationList = res.result['rckp'].nodeTj
                    this.preliminaryEvaluationList = res.result['ybjcy'].nodeTj
                    // this.annualEvaluationList = res.result['ndkp'].ypsc['nodeTj']
                    this.departmentTab.forEach((item,index) => {
                        for (let key in spcyData) {
                            //console.log('9999999999999',key == item.key)
                            if(key == item.key){
                                let bzlcNodeTj = spcyData[key].bzlcNodeTj?spcyData[key].bzlcNodeTj:[]
                                let zjFlowNodeTj = spcyData[key].zjFlowNodeTj?spcyData[key].zjFlowNodeTj:[]
                                let jsscbgFlowNodeTj = spcyData[key].jsscbgFlowNodeTj?spcyData[key].jsscbgFlowNodeTj:[]
                                bzlcNodeTj = bzlcNodeTj.map(i=>{return {...i,type:'补正流程'}})
                                zjFlowNodeTj = zjFlowNodeTj.map(i=>{return {...i,type:'审评专家'}})
                                jsscbgFlowNodeTj = jsscbgFlowNodeTj.map(i=>{return {...i,type:'审查报告'}})
                                this.departmentTab[index].notDone = spcyData[key].dbList
                                this.departmentTab[index].overdue = spcyData[key].dbCqList
                                this.departmentTab[index].linkList = spcyData[key].nodeTj.concat(bzlcNodeTj).concat(zjFlowNodeTj).concat(jsscbgFlowNodeTj)
                                //console.log('我是当前的选项/////////////',spcyData[key].nodeTj)
                                //console.log('我是当前的选项/////////////',key)
                                if((recordIndex == '' && spcyData[key].nodeTj.length) || bzlcNodeTj.length || zjFlowNodeTj.length || jsscbgFlowNodeTj.length){
                                    recordIndex = index
                                    this.departmentActiveKey = index
                                    
                                }
                                let num = 0
                                this.departmentTab[index].linkList.forEach((item1,index1)=>{
                                    num = num + item1.count
                                    //console.log('99999999999999999999',num)
                                    if(this.departmentTab[index].linkList.length == index1+1){
                                        //console.log('99999999999999999999',num)
                                        this.departmentTab[index].num = num
                                    }
                                })
                                
                            }
                            
                        }
                    });
                    this.annualEvaluationTab.forEach((item,index)=>{
                        for (let key in annualEvaluationData ) {
                            if(this.qualitySystemList.length){
                                this.activeKeyBtnLeft = '质量体系文件'
                            }else if(this.dailyEvaluationList.length){
                                this.activeKeyBtnLeft = '审评员日常考评'
                            }else if(this.preliminaryEvaluationList.length){
                                this.activeKeyBtnLeft = '预备审评员考评'
                            }else if(annualEvaluationData[key].nodeTj.length){
                                this.activeKeyBtnLeft = '审评员年度考评'
                            }
                            if(item.key == key && annualEvaluationData[key].nodeTj.length){
                                this.annualEvaluationTabIsDisplay = true
                                this.annualEvaluationTab[index].list = annualEvaluationData[key].nodeTj.map(i=>{return {...i,dep:i.node.indexOf(this.annualEvaluationTab[index].title)==-1?this.annualEvaluationTab[index].title:'',type:this.annualEvaluationTab[index].title}})
                            }
                        }
                    })
                    //console.log('当前列表',this.departmentTab)
                    //console.log('当前列表',this.annualEvaluationTab)
                }
            })

            //oa
            mydbQueryAlloaFlowJob().then(res=>{
                if(res.code == 200){
                    //console.log('oa----------------',res)
                    this.aoFlowPathTab.forEach((item,index)=>{
                        for (let key in res.result) {
                            if(item.key+'list' == key){
                                this.aoFlowPathTab[index].data = res.result[key].oaFlowNode
                            }
                            if(key == item.key){
                                let num = 0
                                this.aoFlowPathTab[index].list = res.result[key].oaFlowNode
                                this.aoFlowPathTab[index].list.forEach((item1,index1)=>{
                                    num = num + item1.count
                                    if(this.aoFlowPathTab[index].list.length == index1+1){
                                        this.aoFlowPathTab[index].num = num
                                    }
                                })
                            }
                            
                        }
                        
                    })
                    //console.log('oa列表',this.aoFlowPathTab)
                }else{
                    this.$message.warning(res.message)
                }
            })

        },
        departmentChange(val){
            this.notDoneData = this.departmentTab[val].notDone
            this.overdueData = this.departmentTab[val].overdue
            this.linkListData = this.departmentTab[val].linkList
            this.currentDepartmentName = this.departmentTab[val].title

        },
        aoFlowPathChange(){

        },
        mouseoutChange(val,index){
            this.isMouseIndex = val.sqsxid?val.sqsxid:val.jobid
        },
        mousemoveChange(){
            this.isMouseIndex = null
        },
        JumpClick(name,title,type){
            //console.log(name,title,type)
            //console.log(name)
            //console.log(title)
            this.linkUrlData.forEach((item,index)=>{
                //console.log(name.indexOf(item.name) !== -1)
                //console.log(title.indexOf(item.title) !== -1)
                if(name.indexOf(item.name) !== -1 && title.indexOf(item.title) !== -1){
                    //console.log(item.type == type)
                    if(item.type && item.type == type){
                        this.$router.push(item.path)
                    }else{
                        this.$router.push(item.url)
                    }
                    
                }
            })
        },
        oaJumpsClick(name,title,type){
            //console.log(name,title,type)
            //console.log(name)
            //console.log(title)
            this.OALinkUrlData.forEach((item,index)=>{
                //console.log(name.indexOf(item.name) !== -1)
                //console.log(title.indexOf(item.title) !== -1)
                if(name.indexOf(item.name) !== -1 && title.indexOf(item.title) !== -1){
                    //console.log(item.type == type)
                    if(item.type && item.type == type){
                        this.$router.push(item.path)
                    }else{
                        this.$router.push(item.url)
                    }
                    
                }
            })
        },
    }
}
</script>
<style lang="less">
.home-ordinary-box{
    color: #000;
    width: 100%;
    .content-left-box{
        display: inline-block;
        width: calc(50% - 6px);
        height: calc(100vh - 150px);
        margin-right: 12px;
        .one-fourth{
            overflow: hidden;
            height: calc(((100% / 4)) - 15px);
            background: #fff;
            margin-bottom: 15px;
        }
        .three-quarter{
            overflow-y: auto;
            height: calc(((100% / 4)*3) - 5px);
            background: #fff;
            .ant-card-body{
                height: calc(100% - 38px);
                padding: 10px !important;
                overflow: auto;
            }
        }
    }
    .content-rigth-box{
        
        display: inline-block;
        width: calc(50% - 6px);
        height: calc(100vh - 150px);
        .two-thirds{
            overflow-y: auto;
            height: calc(((100% / 3)*2) - 15px);
            background: #fff;
            margin-bottom: 15px;
            .ant-card-body{
                height: calc(100% - 38px);
                padding: 10px !important;
                overflow: auto;
            }
        }
        
        .one-third{
            overflow-y: auto;
            height: calc((100% / 3) - 5px);
            background: #fff;
        }
    }
    .processing-statistics-box{
        display: flex;
        height: 100%;
        .statistics-item{
            flex: 1;
            margin: 0px 5px;
            padding: 5px;
            text-align: center;
            font-size: 14px;
            border-radius: 3px;
            overflow: hidden;
            .statistics-num{
                display: inline-block;
                // padding-top: 20px;
                font-size: 30px;
                font-weight: 700;
            }
        }
    }
    .link-list{
        display: flex;
        font-size: 14px;
        flex-wrap: wrap;
        align-items: flex-start;
        .link-for-v{
            margin: 10px;
            display: flex !important;
            flex-direction: column;
            justify-content: center;
            align-items: center;
        }
        .link-item{
            width: 40px;
            height: 40px;
            border-radius: 50%;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 14px;
            position: relative;
            
        }
    }
    .count-v{
        position: absolute;
        width: 20px;
        height: 20px;
        background: #f73131;
        text-align: center;
        color: #fff;
        font-size: 12px;
        top: -7px;
        right: -14px;
        border-top-left-radius: 10px;
        border-top-right-radius: 10px;
        border-bottom-right-radius: 10px

    }
    .mouse-v:hover{
        background: #f0f5ff !important;
    }
    //卡片
    .ant-card-head-title{
        padding: 0 !important;
        line-height: 38px;
    }
    .ant-card-body{
        width: 100%;
        height: calc(100% - 38px);
        overflow: auto;
        padding: 10px !important;
    }
    .ant-tabs-bar{
        border: none !important;
        margin: 0;
    }
    .ant-tabs-nav .ant-tabs-tab{
        padding: 8px 5px;
        padding-top: 0px !important;
    }
}
</style>